﻿@using NewsMine.DomainObjects;
@{
    
    ViewBag.Title = "Index";

    QResult DataFromController = (QResult)Model;
    string previousPageLink = DataFromController.CurrentUrl + "&pgno=" + (DataFromController.PageNumber - 1).ToString();
    string nextPageLink = DataFromController.CurrentUrl + "&pgno=" + (DataFromController.PageNumber + 1).ToString();

    Layout = "~/Views/Shared/_3ColumnMasterLayout.cshtml";
    
}
<script src="@Url.Content("~/scripts/blocksit.js")"></script>
<script>
    window.setInterval(yourfunction, 10000);

    function yourfunction() { $(window).resize(); }

    $(document).ready(function () {



        $('#websiteContainer').BlocksIt({
            numOfCol: 5,
            offsetX: 10,
            offsetY: 10
        });

        $('#websiteContainer').width = $(window).width();
        $(window).resize();

        //blocksit define
        $(window).load(function () {


            $('#websiteContainer').width = $(window).width();
            $(window).resize();



            $('#websiteContainer').BlocksIt({
                numOfCol: 5,
                offsetX: 10,
                offsetY: 10
            });



        });

        //window resize
        var currentWidth = $(window).width();

        $(window).resize(function () {

            $('#websiteContainer').width = $(window).width();
            $('#websiteContainer').BlocksIt({
                numOfCol: 5,
                offsetX: 10,
                offsetY: 10
            });

        });
    });

  

</script>
<div id="maincontainer">
    @if (DataFromController.CurrentDomain != null)
    {
        <div style="text-align: center; margin-bottom: 10px; border-top: 3px double lightgrey;
            border-bottom: 3px double lightgrey;">
            <h1>
                <img style="max-height:100px;" class="img-rounded" src="@DataFromController.CurrentDomain.Logo1Uri" />
                @DataFromController.CurrentDomain.Name</h1>
        </div>
    }
    <div style="text-align: right; margin: 15px;">
        <a id="grid_view_icon" class="btn btn-large" href="../home/Default" title="Grid"><i
            class="icon-th-large"></i>Grid</a> <a id="list_view_icon" class="btn btn-large btn-inverse"
                href="../home/Index" litle="List"><i class="icon-th-list icon-white"></i>List</a>
    </div>
    <hr />
    @RenderPage("~/views/shared/_pagerView.cshtml")
    <div id="contentwrapper" style="text-align: left">
        <div id="contentcolumn">
            <div class="innertube feedContent">
                @{
                    List<FeedItem> feeds = ((QResult)Model).FeedItems;

                    string webSiteIconUrl = "https://plus.google.com/_/favicon?alt=feed&domain=eenj.net";



                    for (int i = 0; i < feeds.Count; i++)
                    {
                        TimeSpan diffTime = DateTime.UtcNow - feeds[i].PubDate;
                    <div style="border-bottom: 1px solid #000; padding-top: 10px; padding-bottom: 20px;
                        background-color: #FFF;">
                        <div style="padding-left: 10px; margin-top: 10px;">
                            <a class="name" style="text-decoration: none;" target="_blank" href="@feeds[i].Link">
                                <div style="overflow: hidden; line-height: 1.6; height: auto; font-size: 24px; color: #a00">
                                    @Html.Raw(feeds[i].Title)
                                </div>
                            </a>
                        </div>
                        @if (!string.IsNullOrEmpty(feeds[i].ImageUrl))
                        {

                            <div style="width: auto; padding: 10px; vertical-align: text-top;">
                                <img class="img-rounded" src="@feeds[i].ImageUrl" style="min-width:200px;width:auto;max-width:350px;"/>
                            </div>
                        }
                        <div>
                            <span>
                                <img src="https://plus.google.com/_/favicon?alt=feed&amp;domain=@feeds[i].Domain " alt="@feeds[i].Domain"/>
                                <span>by @feeds[i].Domain</span> </span>&nbsp;bfr&nbsp; <span><i class="timeago" title="@feeds[i].PubDate.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'")">
                                    @feeds[i].PubDate</i> </span><span class="pull-right">@feeds[i].category
                                    </span>
                        </div>
                    </div>
                    
                    
                    }
                }
            </div>
        </div>
        <div>
        </div>
    </div>
    <div id="leftcolumn" style="text-align: left">
        <div class="innertube">
            @{
                
                List<NewsMine.DomainObjects.WebSiteInfo> websites = new List<NewsMine.DomainObjects.WebSiteInfo>();

                websites = ((QResult)Model).Websites;

                foreach (var website in DataFromController.CurrentLanguageWebsites)
                {
                        
                <span style="border-bottom: 1px solid #FFF; display: block;">
                    <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' alt='website name' />
                    <a href="/source/@website.Domain" ><span style="padding-left: 2px; color: #555;">@Html.Raw(website.Name)
                    </span></a></span>
                           
                        
                }

            //string[] languges = { "English", "Hindi", "Tamil", "Telugu", "Kannada", "Malayalam" };

@*for (int i = 0; i < 6; i++)
                {
                <div style="width: 100%; background-color: #F4F4F4; color: #3B5998; padding-left: 10px;
                    border-bottom: 2px solid #FFF; border-top: 1px solid #FFF; margin-bottom: 5px;
                    margin-top: 5px; font-weight: bolder; font-size: 110%;">
                    <strong>@languges[i].ToString() </strong>
                </div>
                
                    
                    foreach (var website in websites)
                    {
                        if (website.Language != null && website.Language.ToLower() == languges[i].ToLower())
                        {
                <span style="border-bottom: 1px solid #FFF; display: block;">
                    <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' alt='website name' />
                    <a href="?domain=@website.Domain" ><span style="padding-left: 2px; color: #555;">@Html.Raw(website.Name)
                    </span></a></span>
                           
                        }
                    }
                }*@
                
                    
            }
        </div>
    </div>
    <div id="rightcolumn" class="rightColumnGrid">
        <a href="http://www.googleadservices.com/pagead/aclk?sa=L&amp;ai=ClO0oulWQUaPbOojHigf_74DwBb6CsOgDhs_I213AjbcBEAEgAFC2j4iT_P____8BYOWS6IPYDoIBFWNhLWRpZ2l0YWxpbnNwaXJhdGlvbogBAaAB-ua44QPIAQKpAp-kzCsFmFM-qAMBqgRhT9DQeq08G-QcjZB_xmCTBieyJzVMIh_hK3B1CGHFRO4AOQoawZCIl3SX4DWV3wpwbYXD8rFHXvuzL3i_V1tt0OsEnO1qghbsL2T1k_-6gaFNW-AjDXd1mbrVSqs8OpV3rYgGAaAGAoAH7pjHHg&amp;num=1&amp;cid=5Gj9yd_L1fc8OWNdypBdugVZ&amp;sig=AOD64_0qcj6eNt6XWPj3yev3oMxXmHAwfA&amp;client=ca-digitalinspiration&amp;adurl=http://www.rksv.in/landers/DN/%3Futm_source%3Dgoogle%26utm_medium%3DBannerAd%26utm_term%3Drksv_new_banner%26utm_content%3DNew_Freedom_Dream"
            target="_blank">
            <img border="0" src="http://pagead2.googlesyndication.com/simgad/16343421793337181219"
                width="336" height="280"></a>
        @{
                
            List<NewsMine.DomainObjects.WebSiteInfo> websites2 = new List<NewsMine.DomainObjects.WebSiteInfo>();

            websites2 = ((QResult)Model).Websites;

            if (false)
            {
                foreach (var website in websites2)
                {

                    if (!string.IsNullOrEmpty(website.Logo1Uri))
                    {
             
            <div class="grid" style="border-radius: 25px; text-align: center; position: relative;
                border: 1px solid lightgrey;">
                <a class="name" style="text-decoration: none;text-align:center;left:50%;top:50%;" target="_self" href="?domain=@website.Domain">
                    <img style="max-width:100px;max-height:100px;margin-left:auto;margin-right: auto;"  src="@website.Logo1Uri" />
                    <h5>
                        Follow>>
                    </h5>
                </a>
            </div>

                    }

                }
            }

        }
    </div>
    @RenderPage("~/views/shared/_pagerView.cshtml")
    <div style="width: 100%; height: auto; border: 1px solid black; background-color: black;
        color: white; text-align: center; clear: both;">
        <h2>
            OUR RESPECTFUL NEWS SOURCES</h2>
    </div>
    <div id="websiteContainer" style="width: 1100px; position: relative; margin: 0 auto 25px;
        background-color: #505050; border-top: #000;">
        @{
                
            List<NewsMine.DomainObjects.WebSiteInfo> websites1 = new List<NewsMine.DomainObjects.WebSiteInfo>();

            websites1 = ((QResult)Model).CurrentLanguageWebsites;

            foreach (var website in websites1)
            {

                if (!string.IsNullOrEmpty(website.Logo1Uri))
                {
             
            <div class="grid" style="border-radius: 25px; text-align: center; position: relative;
                border: 1px solid lightgrey;">
                <p>@website.Language</p>
                <a class="name" style="text-decoration: none;text-align:center;left:50%;top:50%;" target="_self" href="/source/@website.Domain">
                    <img style="max-width:100px;max-height:100px;margin-left:auto;margin-right: auto;"  src="@website.Logo1Uri" />
                    <h5>
                        @Html.Raw(website.Name)
                    </h5>
                </a>
            </div>

                }

            }

        }
    </div>
</div>
